
#ifndef PLAYER_H
#define PLAYER_H

#include<QGraphicsPixmapItem>
#include<QObject>


class QGraphicsTextItem;
class Player: public QObject, public QGraphicsPixmapItem
{
    Q_OBJECT

public:


    Player(QGraphicsItem*parent=nullptr);

    // QGraphicsItem interface
protected:
    virtual void keyPressEvent(QKeyEvent *event) override;
private:
    void enemySpawn();
    void hongSpawn();
    void jushiSpawn();
    void t_cellSpawn();
    void gameOver();
    void explain();

    // QObject interface
protected:
    virtual void timerEvent(QTimerEvent *) override;
private:
    int playing=1;
    int N=0;
    bool win=0;
    QGraphicsTextItem *messageItem=nullptr;
    QGraphicsTextItem *messageItemwin=nullptr;
    QGraphicsTextItem *messageItemN=nullptr;
    QGraphicsTextItem *messageItemN1=nullptr;
    QGraphicsTextItem *messageItemN10=nullptr;
    QGraphicsTextItem *messageItemN2=nullptr;
    QGraphicsTextItem *messageItemN20=nullptr;
    QGraphicsTextItem *messageItemN3=nullptr;
    QGraphicsTextItem *messageItemN30=nullptr;
    QGraphicsTextItem *messageItemN4=nullptr;
    QGraphicsTextItem *messageItemN40=nullptr;
    QGraphicsTextItem *messageItemN5=nullptr;
    QGraphicsTextItem *messageItemN50=nullptr;
};

#endif // PLAYER_H

